package com.bsfcs.rag.enums;

public enum IsAccountsEnum {
    TASK(0, "任务"),
    MILESTONE(1, "里程碑"),
    WORKLOAD_MILESTONE(2, "工作量里程碑"),
    CONFIRMED_MILESTONE(3, "确认收入里程碑"),
    DEFAULT(-1, "");

    private final int code;
    private final String displayName;

    IsAccountsEnum(int code, String displayName) {
        this.code = code;
        this.displayName = displayName;
    }

    public int getCode() {
        return code;
    }

    public String getDisplayName() {
        return displayName;
    }

    public static IsAccountsEnum fromCode(int code) {
        for (IsAccountsEnum value : IsAccountsEnum.values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return DEFAULT;
    }
}
